package com.ddz.library.resource

import android.util.TypedValue
import androidx.core.content.ContextCompat
import com.ddz.library.JKLibrary

fun Float.dp(): Float {
    return TypedValue.applyDimension(
        TypedValue.COMPLEX_UNIT_DIP,
        this,
        JKLibrary.context!!.resources.displayMetrics
    )
}

fun Float.sp(): Float {
    return TypedValue.applyDimension(
        TypedValue.COMPLEX_UNIT_SP,
        this,
        JKLibrary.context!!.resources.displayMetrics
    )
}

fun Int.toColor():Int{
    return ContextCompat.getColor(JKLibrary.context!!,this)
}

class ResourceUtils {
}